/**
 * @Author     :lanbery
 * @e-mail     : lanbery@gmail.com
 * @version    : V1.0
 * @createtime : 2011-11-15-下午07:19:01
 */
package com.lambor.example.dao.impl;

import javax.inject.Inject;

import org.springframework.dao.DataAccessException;

import com.lambor.common.dao.BaseMapperDao;
import com.lambor.example.dao.AccountDao;
import com.lambor.example.entity.Account;
import com.lambor.example.mapper.AccountMapper;

/**
 * @about this class :
 * @author           ： lanbery
 * @e-mail           : lanbery@gmail.com
 * @version          : V1.0
 * @modifytime       : 2011-11-15-下午07:19:01
 * @filepath         : SSI-com.lambor.example.dao.impl//AccountDaoImpl.java
 *
 */
public class AccountDaoImpl<T extends Account> implements AccountDao<T>{

	@Inject
	private BaseMapperDao<Account> dao;
	/* (non-Javadoc)
	 * @see com.lambor.example.dao.impl.AccountDao#addAccount(java.lang.Object)
	 */
	public boolean addAccount(T entity) throws DataAccessException {
	       dao.setMapperClass(AccountMapper.class);
	        boolean flag = false;
	        try {
	            dao.add(entity);
	            flag = true;
	        } catch (DataAccessException e) {
	            flag = false;
	            throw e;
	        } catch (Exception e) {
	            throw new RuntimeException(e);
	        }
	        return flag;
	}



}
